<?php
$v_current_style_name = "odd_row";
$v_next_style_name="";
?>
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="page_title">
		<td colspan="2"><?php echo CONST_AF_SEARCH_BY_HISTORY_LABEL; ?></td>
	</tr>
	<tr><td height="10"></td></tr>
</table>
<div style="overflow: auto; width: 100%; height:200pt;padding-left:0px;margin:0px">
<?php

if ($count_af>0){?>
		<table class="list_table" width="100%" cellpadding="0" cellspacing="0">
		<col width="10%"><col width="85%"><col width="5%">		
		<tr class="header">
			<td align="center"><?php echo CONST_AF_ORDER; ?></td>
			<td align="center"><?php echo CONST_AF_NAME_LABEL; ?></td>
		</tr><?php
		$stt=($page-1)*$limit;			
		for($v_index = 0; $v_index < $count_af; $v_index++){
			$v_af_stt= $arr_all_af_by_history[$v_index]['0'];
			$v_af_viewed_id = $arr_all_af_by_history[$v_index]['1'];
			$v_af_id = $arr_all_af_by_history[$v_index]['2'];	
			$v_time = $arr_all_af_by_history[$v_index]['4'];
			$v_ip_address = $arr_all_af_by_history[$v_index]['5'];												
			$v_af_name = $arr_all_af_by_history[$v_index]['6'];				
			$v_url = "index.php?fuseaction=DISPLAY_SINGLE_AF&v_session=".$v_session."&af_id=" . $v_af_id;
			if ($v_current_style_name == "odd_row"){
				$v_current_style_name = "round_row";
			}else{
				$v_current_style_name = "odd_row";
			}
			$stt += 1;	?>		
			<tr class="<?php echo $v_current_style_name ?>"> 
				<td align="center">
						<a href="<?php echo $v_url;?>"><?php echo $stt;?></a>
				</td>
				<td align="left"><?php 
				if ($v_af_id > 0){?>
					<img src="<?php echo $_ISA_IMAGE_URL_PATH?>doc.gif"><?php
				}?>	
					<a href="<?php echo $v_url;?>"><?php echo $v_af_name;?></a>
				</td>					
			</tr><?php 
		}
		if ($v_current_style_name == "odd_row"){
			$v_next_style_name = "round_row";
		}else{
			$v_next_style_name = "odd_row";
		}
		echo _add_empty_row($count_af,CONST_LIMIT_AF_PAGE,$v_current_style_name,$v_next_style_name,2);?>
	</table>
</div><?php
}else{
		echo CONST_NO_AF_MESSAGE;
}?>
<table>
	<tr>
		<col width="5%"><col width="95%">
		<td align="center" class="normal_label">
			<b> 
			<? 
			if ($v_total_af_count > $v_limit) 
			{//(*)
			if ($page == 1)  
				echo "<img src=" . $_ISA_IMAGE_URL_PATH . "d-arrow-left.jpg class=normal_image align=center>"; 
			else            
				echo "<a href=\"index.php?fuseaction=DISPLAY_ALL_AF_BY_HISTORY&v_session=".$v_session."&page=".($page - 1). "\">". "<img src=" . $_ISA_IMAGE_URL_PATH . "arrow-left.jpg class=normal_image align=center>" . "</a>";
			
			for ($i = 1; $i <= $pager->numPages; $i++) { 
				echo " | "; 
				if ($i == $pager->page)
					echo $i; 
				else 
					 echo "<a href=\"index.php?fuseaction=DISPLAY_ALL_AF_BY_HISTORY&v_session=".$v_session."&page=". $i. "\">". $i."</a>";
				}//dong for
			
			if ($page == $pager->numPages) 
				echo " | ". "<img src=" . $_ISA_IMAGE_URL_PATH . "d-arrow-right.jpg class=normal_image align=center>"; 
			else            
				echo " | ". "<a href=\"index.php?fuseaction=DISPLAY_ALL_AF_BY_HISTORY&v_session=".$v_session."&page=".($page + 1) . "\">" . "<img src=" . $_ISA_IMAGE_URL_PATH . "arrow-right.jpg class=normal_image align=center>" . "</a>";
			}
			?>
			</b>
		</td>
	</tr>
</table>